﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
      <html>
        <head>
          <!-- 页面标题 -->
          <title>
            <xsl:value-of select="MILK_RECORD/@title"/>：
            <xsl:value-of select="MILK_RECORD/RECORD_ID"/>（履历码）
          </title>
          <script type="text/javascript" src="jquery.js"></script>
          <script type="text/javascript" src="milk_record.js"></script>
          <link type="text/css" rel="stylesheet" href="milk_record.css"/>
        </head>
        <body>
          <div style="text-align:center;">
            <!-- 牛奶履历抬头 -->
            <div>
              <p><b id="record_title"><xsl:value-of select="MILK_RECORD/@title"/></b></p>
              <p style="">履历码：<xsl:value-of select="MILK_RECORD/RECORD_ID"/></p>
            </div>
			
            <!-- “牧场端|挤乳”报告 -->
            <div class="report" id="milking">
              <xsl:for-each select="MILK_RECORD/MILKING">
                <p class="report_title">[<xsl:value-of select="@title"/>]</p>
                <table style="float:right;">
                  <tr>
                    <td class="darker right"><xsl:value-of select="START_TIME/@title"/></td>
                    <td class="lighter"><xsl:value-of select="START_TIME"/></td>
                    <td class="darker right"><xsl:value-of select="MILKER/@title"/></td>
                    <td class="lighter"><xsl:value-of select="MILKER"/></td>
                  </tr>
                  <tr>
                    <td class="darker right"><xsl:value-of select="END_TIME/@title"/></td>
                    <td class="lighter"><xsl:value-of select="END_TIME"/></td>
                    <td class="darker right"><xsl:value-of select="TEMPRATURE/@title"/></td>
                    <td class="lighter"><xsl:value-of select="TEMPRATURE"/>
                      <xsl:value-of select="TEMPRATURE/@units"/></td>
                  </tr>
                </table>
                <table width="100%">
                  <tr>
                    <td class="darker"><xsl:value-of select="COWS_INFO/@title"/></td>
                  </tr>
                  <tr>
                    <td class="hilight center"><xsl:value-of select="COWS_INFO/HEAD_COUNT/@title"/></td>
                    <td class="hilight center"><xsl:value-of select="COWS_INFO/AVG_HEIGHT/@title"/></td>
                    <td class="hilight center"><xsl:value-of select="COWS_INFO/AVG_WEIGHT/@title"/></td>
                  </tr>
                  <tr>
                    <td class="center"><xsl:value-of select="COWS_INFO/HEAD_COUNT"/>
                      (<xsl:value-of select="COWS_INFO/HEAD_COUNT/@units"/>)</td>
                    <td class="center"><xsl:value-of select="COWS_INFO/AVG_HEIGHT"/>
                      (<xsl:value-of select="COWS_INFO/AVG_HEIGHT/@units"/>)</td>
                    <td class="center"><xsl:value-of select="COWS_INFO/AVG_WEIGHT"/>
                      (<xsl:value-of select="COWS_INFO/AVG_WEIGHT/@units"/>)</td>
                  </tr>
                </table>
              </xsl:for-each>
            </div>
			
            <!-- “牧场端|生乳运输”报告 -->
            <div class="report" id="transport">
              <xsl:for-each select="MILK_RECORD/TRANSPORT">
                <p class="report_title">[<xsl:value-of select="@title" />]</p>
                <div width="100%" style="text-align:center;">
                  <table>
                    <tr>
                      <td class="hilight right"><xsl:value-of select="START_TIME/@title"/></td>
                      <td class="lighter"><xsl:value-of select="START_TIME"/></td>
                    </tr>
                    <tr>
                      <td class="hilight right"><xsl:value-of select="DRIVER/@title"/></td>
                      <td class="lighter"><xsl:value-of select="DRIVER"/></td>
                    </tr>
                    <tr>
                      <td class="hilight right"><xsl:value-of select="CAR_LICENSE/@title"/></td>
                      <td class="lighter"><xsl:value-of select="CAR_LICENSE"/></td>
                    </tr>
                    <tr>
                      <td class="hilight right"><xsl:value-of select="TEMPRATURE/@title"/></td>
                      <td class="lighter"><xsl:value-of select="TEMPRATURE"/>
                        <xsl:value-of select="TEMPRATURE/@units"/></td>
                    </tr>
                    <tr>
                      <td class="hilight right"><xsl:value-of select="ARRIVAL_TIME/@title"/></td>
                      <td class="lighter"><xsl:value-of select="ARRIVAL_TIME"/></td>
                    </tr>
                  </table>
                </div>
              </xsl:for-each>
            </div>
			
            <!-- “工厂端|生乳槽检验”报告 -->
            <div class="report" id="raw_report">
              <xsl:for-each select="MILK_RECORD/RAW_REPORT">
                <p class="report_title">[<xsl:value-of select="@title" />]</p>
                <table style="float:right;">
                  <tr>
                    <td class="darker right"><xsl:value-of select="INSPECTMEMBER/@title"/></td>
                    <td class="lighter"><xsl:value-of select="INSPECTMEMBER"/></td>
                  </tr>
                  <tr>
                    <td class="darker right"><xsl:value-of select="TEMPRATURE/@title"/></td>
                    <td class="lighter"><xsl:value-of select="TEMPRATURE"/>
                      <xsl:value-of select="TEMPRATURE/@units"/></td>
                  </tr>
                </table>
                <table width="100%">
                  <tr>
                    <td class="hilight center"><xsl:value-of select="TANK_ID/@title"/></td>
                    <td class="hilight center" colspan="2"><xsl:value-of select="TANK_ID"/></td>
                  </tr>
                  <tr>
                    <td class="hilight center"><xsl:value-of select="DETAILS/@title"/></td>
                    <td class="hilight center"><xsl:value-of select="DETAILS/TEMPRATURE/REQUIREMENTS/@title"/></td>
                    <td class="hilight center"><xsl:value-of select="DETAILS/TEMPRATURE/RESULT/@title"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/TEMPRATURE/@title"/>
                      (<xsl:value-of select="DETAILS/TEMPRATURE/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/TEMPRATURE/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/TEMPRATURE/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/FLAVOUR/@title"/></td>
                    <td><xsl:value-of select="DETAILS/FLAVOUR/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/FLAVOUR/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/FAT/@title"/>
                      (<xsl:value-of select="DETAILS/FAT/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/FAT/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/FAT/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/PROTEIN/@title"/>
                      (<xsl:value-of select="DETAILS/PROTEIN/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/PROTEIN/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/PROTEIN/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/@title"/>
                      (<xsl:value-of select="DETAILS/SOLIDS_NON_FAT/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/RESULT"/></td>
                  </tr>
                </table>
              </xsl:for-each>
            </div>

            <!-- “工厂端|130℃高温杀菌”报告 -->
            <div class="report" id="sterilization">
              <xsl:for-each select="MILK_RECORD/STERILIZATION">
                <p class="report_title">
                  [<xsl:value-of select="@title" />]
                </p>
                <div width="100%" style="text-align:center;">
                  <table>
                    <tr>
                      <td class="hilight right"><xsl:value-of select="START_TIME/@title"/></td>
                      <td class="lighter"><xsl:value-of select="START_TIME"/></td>
                    </tr>
                    <tr>
                      <td class="hilight right"><xsl:value-of select="END_TIME/@title"/></td>
                      <td class="lighter"><xsl:value-of select="END_TIME"/></td>
                    </tr>
                  </table>
                </div>
              </xsl:for-each>
            </div>

            <!-- “工厂端|成品槽检验”报告 -->
            <div class="report" id="finish_report">
              <xsl:for-each select="MILK_RECORD/FINISH_REPORT">
                <p class="report_title">
                  [<xsl:value-of select="@title" />]
                </p>
                <table style="float:right;">
                  <tr>
                    <td class="darker right"><xsl:value-of select="ENTER_TIME/@title"/></td>
                    <td class="lighter"><xsl:value-of select="ENTER_TIME"/></td>
                  </tr>
                  <tr>
                    <td class="darker right"><xsl:value-of select="CONTROLMEMBER/@title"/></td>
                    <td class="lighter"><xsl:value-of select="CONTROLMEMBER"/></td>
                  </tr>
                  <tr>
                    <td class="darker right"><xsl:value-of select="TEMPRATURE/@title"/></td>
                    <td class="lighter"><xsl:value-of select="TEMPRATURE"/>
                      <xsl:value-of select="TEMPRATURE/@units"/></td>
                  </tr>
                </table>
                <table width="100%">
                  <tr>
                    <td class="hilight center"><xsl:value-of select="DETAILS/@title"/></td>
                    <td class="hilight center"><xsl:value-of select="DETAILS/TEMPRATURE/REQUIREMENTS/@title"/></td>
                    <td class="hilight center"><xsl:value-of select="DETAILS/TEMPRATURE/RESULT/@title"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/TEMPRATURE/@title"/>
                      (<xsl:value-of select="DETAILS/TEMPRATURE/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/TEMPRATURE/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/TEMPRATURE/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/FLAVOUR/@title"/></td>
                    <td><xsl:value-of select="DETAILS/FLAVOUR/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/FLAVOUR/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/FAT/@title"/>
                      (<xsl:value-of select="DETAILS/FAT/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/FAT/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/FAT/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/PROTEIN/@title"/>
                      (<xsl:value-of select="DETAILS/PROTEIN/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/PROTEIN/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/PROTEIN/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/@title"/>
                      (<xsl:value-of select="DETAILS/SOLIDS_NON_FAT/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="hilight center"><xsl:value-of select="QUALIFICATION/@title"/></td>
                    <td class="hilight center" colspan="2"><xsl:value-of select="QUALIFICATION"/></td>
                  </tr>
                 </table>
              </xsl:for-each>
            </div>

            <!-- “工厂端|填充包装”报告 -->
            <div class="report" id="product_package">
              <xsl:for-each select="MILK_RECORD/PRODUCT_PACKAGE">
                <p class="report_title">
                  [<xsl:value-of select="@title" />]
                </p>
                <div width="100%" style="text-align:center;">
                  <table>
                    <tr>
                      <td class="hilight right"><xsl:value-of select="PACKAGE_TYPE/@title"/></td>
                      <td class="lighter"><xsl:value-of select="PACKAGE_TYPE"/></td>
                      <td class="hilight right"><xsl:value-of select="VOLUME/@title"/></td>
                      <td class="lighter"><xsl:value-of select="VOLUME"/>
                        <xsl:value-of select="VOLUME/@units"/></td>
                    </tr>
                  </table>
                </div>
              </xsl:for-each>
            </div>

            <!-- “工厂端|成品检查报告”报告 -->
            <div class="report" id="product_report">
              <xsl:for-each select="MILK_RECORD/PRODUCT_REPORT">
                <p class="report_title">
                  [<xsl:value-of select="@title" />]
                </p>
                <table width="100%">
                  <tr>
                    <td class="hilight center"><xsl:value-of select="PRODUCT_NAME/@title"/></td>
                    <td class="hilight" colspan="3"><xsl:value-of select="PRODUCT_NAME"/></td>
                  </tr>
                  <tr>
                    <td class="hilight center"><xsl:value-of select="REPORT_DATE/@title"/></td>
                    <td class="hilight"><xsl:value-of select="REPORT_DATE"/></td>
                    <td class="hilight center"><xsl:value-of select="VOLUME_SPEC/@title"/>
                      (<xsl:value-of select="VOLUME_SPEC/@units"/>)</td>
                    <td class="hilight"><xsl:value-of select="VOLUME_SPEC"/></td>
                  </tr>
                  <tr>
                    <td class="hilight center"><xsl:value-of select="TRACK_ID/@title"/></td>
                    <td class="hilight"><xsl:value-of select="TRACK_ID"/></td>
                    <td class="hilight center"><xsl:value-of select="CARRIED_STANDARD/@title"/></td>
                    <td class="hilight"><xsl:value-of select="CARRIED_STANDARD"/></td>
                  </tr>
                </table>
                <table width="100%">
                  <tr>
                    <td class="hilight center"><xsl:value-of select="DETAILS/@title"/></td>
                    <td class="hilight center"><xsl:value-of select="DETAILS/SENSE/REQUIREMENTS/@title"/></td>
                    <td class="hilight center"><xsl:value-of select="DETAILS/SENSE/RESULT/@title"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/SENSE/@title"/></td>
                    <td><xsl:value-of select="DETAILS/SENSE/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/SENSE/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/NET_WEIGHT/@title"/>
                      (<xsl:value-of select="DETAILS/NET_WEIGHT/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/NET_WEIGHT/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/NET_WEIGHT/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/FAT/@title"/>
                      (<xsl:value-of select="DETAILS/FAT/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/FAT/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/FAT/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/PROTEIN/@title"/>
                      (<xsl:value-of select="DETAILS/PROTEIN/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/PROTEIN/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/PROTEIN/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="darker center"><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/@title"/>
                      (<xsl:value-of select="DETAILS/SOLIDS_NON_FAT/@units"/>)</td>
                    <td><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/REQUIREMENTS"/></td>
                    <td><xsl:value-of select="DETAILS/SOLIDS_NON_FAT/RESULT"/></td>
                  </tr>
                  <tr>
                    <td class="hilight center"><xsl:value-of select="QUALIFICATION/@title"/></td>
                    <td class="hilight center" colspan="2"><xsl:value-of select="QUALIFICATION"/></td>
                  </tr>
                  <tr>
                    <td class="hilight center"><xsl:value-of select="INSPECTMEMBER/@title"/></td>
                    <td class="hilight center" colspan="2"><xsl:value-of select="INSPECTMEMBER"/></td>
                  </tr>
                </table>
              </xsl:for-each>
            </div>

            <p>Copyright ｛ZhangYifan® FuLin® ZhaoYan® GongDapeng®｝™ All Rights Reserved.</p>
            
          </div>
        </body>
      </html>
    </xsl:template>
</xsl:stylesheet>
